bitkeeper revision 1.1159.1.457 (41a6208fnzPMz8K5OTxEm1zY27pA-w)
authorcl349@arcadians.cl.cam.ac.uk <cl349@arcadians.cl.cam.ac.uk>
Thu, 25 Nov 2004 18:12:31 +0000 (18:12 +0000)
committercl349@arcadians.cl.cam.ac.uk <cl349@arcadians.cl.cam.ac.uk>
Thu, 25 Nov 2004 18:12:31 +0000 (18:12 +0000)
traps.c, memory.c:
  Reposition big lock around writable pagetable fault handler.

xen/arch/x86/memory.c
xen/arch/x86/traps.c

index fc57e0bf1cf4257216de6a319ad1a8ed3777e6d7..f5eac75ffe528a86db71288702e7dbbabc151a66 100644 (file)
@@ -1761,9 +1761,7 @@ int ptwr_do_page_fault(unsigned long addr)
     l2_pgentry_t    *pl2e;
     int              which, cpu = smp_processor_id();
     u32              l2_idx;
-    struct domain   *d = current->domain;
 
-    LOCK_BIGLOCK(d);
     /*
      * Attempt to read the PTE that maps the VA being accessed. By checking for
      * PDE validity in the L2 we avoid many expensive fixups in __get_user().
@@ -1772,7 +1770,6 @@ int ptwr_do_page_fault(unsigned long addr)
            _PAGE_PRESENT) ||
          __get_user(pte, (unsigned long *)&linear_pg_table[addr>>PAGE_SHIFT]) )
     {
-        UNLOCK_BIGLOCK(d);
         return 0;
     }
 
@@ -1783,7 +1780,6 @@ int ptwr_do_page_fault(unsigned long addr)
     if ( ((pte & (_PAGE_RW | _PAGE_PRESENT)) != _PAGE_PRESENT) ||
          ((page->u.inuse.type_info & PGT_type_mask) != PGT_l1_page_table) )
     {
-        UNLOCK_BIGLOCK(d);
         return 0;
     }
     
@@ -1791,7 +1787,6 @@ int ptwr_do_page_fault(unsigned long addr)
     l2_idx = page->u.inuse.type_info & PGT_va_mask;
     if ( unlikely(l2_idx >= PGT_va_unknown) )
     {
-        UNLOCK_BIGLOCK(d);
         domain_crash(); /* Urk! This L1 is mapped in multiple L2 slots! */
     }
     l2_idx >>= PGT_va_shift;
@@ -1870,12 +1865,9 @@ int ptwr_do_page_fault(unsigned long addr)
         /* Toss the writable pagetable state and crash. */
         unmap_domain_mem(ptwr_info[cpu].ptinfo[which].pl1e);
         ptwr_info[cpu].ptinfo[which].l1va = 0;
-        UNLOCK_BIGLOCK(d);
         domain_crash();
     }
     
-    UNLOCK_BIGLOCK(d);
-
     return EXCRET_fault_fixed;
 }
 
index 11687c05737b3c7537e033b0c68946c5d31cc7bf..1a7a52c05d5767fa9e5c685d05a295440027c448 100644 (file)
@@ -386,11 +386,11 @@ asmlinkage int do_page_fault(struct xen_regs *regs)
 
     if ( likely(VM_ASSIST(d, VMASST_TYPE_writable_pagetables)) )
     {
+        LOCK_BIGLOCK(d);
         if ( unlikely(ptwr_info[cpu].ptinfo[PTWR_PT_ACTIVE].l1va) &&
              unlikely((addr >> L2_PAGETABLE_SHIFT) ==
                       ptwr_info[cpu].ptinfo[PTWR_PT_ACTIVE].l2_idx) )
         {
-            LOCK_BIGLOCK(d);
             ptwr_flush(PTWR_PT_ACTIVE);
             UNLOCK_BIGLOCK(d);
             return EXCRET_fault_fixed;
@@ -402,8 +402,10 @@ asmlinkage int do_page_fault(struct xen_regs *regs)
         {
             if ( unlikely(ed->mm.shadow_mode) )
                 (void)shadow_fault(addr, regs->error_code);
+            UNLOCK_BIGLOCK(d);
             return EXCRET_fault_fixed;
         }
+        UNLOCK_BIGLOCK(d);
     }
 
     if ( unlikely(ed->mm.shadow_mode) &&